import time
import unittest
from Finance_fun.base.get_driver import GetDriver

from Finance_fun.page.page03_transaction import PageTransaction


class TransactionTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = GetDriver.get_driver()
        cls.transaction = PageTransaction(cls.driver)
        cls.transaction.page_click_login_link()
        cls.transaction.page_login("13129628532","W123456")

    @classmethod
    def tearDownClass(cls):
        GetDriver.quit_driver()

    def test01_transaction_01(self):
        # 点击交易记录
        self.transaction.page_click_transaction_record()
        # 选择开始时间
        self.transaction.check_start_date("2024-05-01")
        # 选择截止日期
        self.transaction.check_end_date("2024-05-20")
        # 点击筛选按钮
        self.transaction.click_filter_btn()

    def test02_transaction_02(self):
        # 点击充值记录
        self.transaction.click_cz_btn()
        time.sleep(10)
        # 选择开始时间
        self.transaction.check_start_date1("2024-05-01")
        # 选择截止日期
        self.transaction.check_end_date("2024-05-20")
        # 点击筛选按钮
        self.transaction.click_filter_btn()

    def test03_transaction_03(self):
        # 点击充值记录
        self.transaction.click_tx_btn()
        time.sleep(10)
        # 选择开始时间
        self.transaction.check_start_date1("2024-05-01")
        # 选择截止日期
        self.transaction.check_end_date("2024-05-20")
        # 点击筛选按钮
        self.transaction.click_filter_btn()